/*
 * @message: 描述
 * @Author: Roy
 * @Email: cx_love_xc@163.com
 * @Github: cx_love_xc@163.com
 * @Date: 2022-01-18 11:52:56
 * @LastEditors: Roy
 * @LastEditTime: 2022-01-18 11:56:24
 * @Deprecated: 否
 * @FilePath: /blog/src/admin/util/index.js
 */
export const getLoginStatus = () => {
    const token = localStorage.authingToken;
    const tokenExpiredAt = localStorage.tokenExpiredAt;
    const currentTime = (new Date()).getTime();
    const expiredTime = (new Date(tokenExpiredAt)).getTime();
    let login = false;
    if (token && (currentTime <= expiredTime)) {
        login = true;
    }
    if (!login) {
        localStorage.removeItem('authingToken')
        localStorage.removeItem('tokenExpiredAt')
        localStorage.removeItem('photo')
    }
    return login;
}